package com.study.spring.ch06.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@RequestMapping(value = "/ch06/errorUniform") // ①处理器的通用映射前缀
@Controller
public class ErrorUniformController {

	
	/**
	 * 测试  com.study.spring.ch06.controller.MyExceptionHandler 的触发
	 * @return
	 */
	@RequestMapping("/nullTest")
	public String hello1() {
		String a = null;
		a.length();
		return "success";
	}

	/**
	 * 测试 com.study.spring.ch06.controller.MyExceptionHandler 的触发
	 * @return
	 */
	@RequestMapping("/arrayIndexOutTest")
	public String hello2() {
		String a[] = { "1" };
		a[1] = "2";
		return "success";
	}

}
